package top.ryw.ssm2.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.ryw.ssm2.pojo.User;
import top.ryw.ssm2.service.UserService;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/list")
    @ResponseBody
    public Object list() {
        List<User> users = userService.selectList();
        return users;


    }


}
